<?php


namespace App;


use Illuminate\Support\Facades\Cache;

class ProductService
{
    public function getInfoById($id)
    {
        $name = 'proidd_'.$id;

        $rs = Cache::get($name);
        if (!$rs) {
            $rs = ['name' => 'shushanshan','age' => 25];
            Cache::put($name,$rs);
        }
        $redis = app('redis.connection');
        $redis->set('test21',1);
        return '产品ID为'.$rs;
    }
}
